#include <iostream>
using namespace std;

class Array {
  private:
    int *elem;
    int size;

  public:
    Array(int a[], int sz) : elem(a), size(sz) {}
    int GetSize() const { return size; }
    int &operator[](int pos) { return elem[pos - 1]; }
};

int main() {
    int a[] = {1, 2, 3, 4, 5};
    Array ar(a, 5);

    ar[1] = 8;
    for (int i = 1; i <= ar.GetSize(); i++)
        cout << ar[i] << "  ";
    cout << endl;

    return 0;
}
